UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TQe9KIeoEzgr7ErdYArwo9QgTYTsz8zbLu53ZOvN6y4='
WHERE
key_id = '3f1ce67629166d19f16caf72a3f62b3b26bf6cc2da972ea5eea2e777e4c4e5f6'
AND (
token = 'TQe9KIeoEzgr7ErdYArwo9QgTYTsz8zbLu53ZOvN6y4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)