I have a query that was originally written for MySQL that writes a timestamp to a record. The query adds 15 minutes to the timestamp, based on the time the query is run.
$query = $con->prepare("UPDATE TableName SET
LockExpiryTime=ADDTIME(NOW(),'00:15:00'),LockKey=:lockkey
WHERE NOW() > LockExpiryTime AND formID = :formid");
$data = array('lockkey'=>$_SESSION['LockKey'],'formid'=>$_SESSION['formId']);
$query->execute($data);
I know that NOW() is not used in SQL Server, so I'm wondering how I can reconfigure this query to work in it and write the timestamp to a timestamp field. Or would datetime be better in this case?
EDIT: I should explain what this is used for. When the user logs into a form, a lock key and expiration time are generated. The lock lasts fifteen minutes. When the user logs out, both the key and expiry time are reset.