UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2EbRhVfeqdw6veS/4ZmH5QiFBYfRIYLZeJHA04KXpXw='
WHERE
key_id = '6636c0c9c82860c6f919929fb01de575206ad8b697956d99eccfa8accc8eb76e'
AND (
token = '2EbRhVfeqdw6veS/4ZmH5QiFBYfRIYLZeJHA04KXpXw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)