UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xu54EG2eEPLh7W2DqEkVIqtzTmtw0kMa4NlSJm1v37E='
WHERE
key_id = '5f408435db6f5d0d1128479389eb540767a6f53740581e7974aa1487de8bae6b'
AND (
token = 'xu54EG2eEPLh7W2DqEkVIqtzTmtw0kMa4NlSJm1v37E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)