UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jarF7NIMR6wQbUYE5fqo338SM+53SqLOoqrRURn1fsc='
WHERE
key_id = '53865c6bc08a2fc350351f63cb0295d8f493411885b877dca2a38279cb187247'
AND (
token = 'jarF7NIMR6wQbUYE5fqo338SM+53SqLOoqrRURn1fsc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)