UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'F7V2y0IW6WOi0/1mMMnUyFTktlzUq0yg/BNgkzdc89w='
WHERE
key_id = 'e6d7d856d3803fee754641089082bbca6bd1384ee11728a7182b2053dd97efb4'
AND (
token = 'F7V2y0IW6WOi0/1mMMnUyFTktlzUq0yg/BNgkzdc89w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)