UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JQfzJuh3ygn9UmhYJv6tAx3A5gyZotIheoHT7VljGhQ='
WHERE
key_id = '1607a23c1cfaf8a8e9e9237820f6e246b6a42d5453df5ab285ae87bdf12af275'
AND (
token = 'JQfzJuh3ygn9UmhYJv6tAx3A5gyZotIheoHT7VljGhQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)