UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SIN/xI+fywOJU6/o3jN6VQ+tNUM9J9oacxTMdHELatY='
WHERE
key_id = 'fc36372de85caa3f754569b8af95aebbfc81400064756a585ce4d1c229b07628'
AND (
token = 'SIN/xI+fywOJU6/o3jN6VQ+tNUM9J9oacxTMdHELatY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)