UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Q4Q6oVfQ6fOwod5BO5aIKfTiofqsLffxNj4gyHOT0HY='
WHERE
key_id = 'ebae0903b2891dd6ce52416a241d7c949c2b79ccae47fbf7810b984552f47091'
AND (
token = 'Q4Q6oVfQ6fOwod5BO5aIKfTiofqsLffxNj4gyHOT0HY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)