UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sFUOkS6SJAK5lNPO76t2uHGgJYUC+IJ6CxxqA9WjbuY='
WHERE
key_id = 'af46bcc6a98a061e6f46f982011ba2553602ce1928f27705ff28180d58473273'
AND (
token = 'sFUOkS6SJAK5lNPO76t2uHGgJYUC+IJ6CxxqA9WjbuY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)