UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VEn4oam3igjUicEb0hqOMszxXv7Q9lqOwpKgVZ40Hw4='
WHERE
key_id = '53608614dd382b69ce7cd4f9b8211e7898f1c0db38cc0a52b9b61fd598b5460f'
AND (
token = 'VEn4oam3igjUicEb0hqOMszxXv7Q9lqOwpKgVZ40Hw4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)