UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AEqTUnPZ/v9vQ/QKfrbOfAhJ/SFrWbid9WbOcWOSxQg='
WHERE
key_id = '48d516c16fc53a28fb04d83aeef8d5a4bb74caf7e0fbb3c2f5b7ea863688cf6b'
AND (
token = 'AEqTUnPZ/v9vQ/QKfrbOfAhJ/SFrWbid9WbOcWOSxQg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)