UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0nyf6/szuGy41YIeuuWciqVlTHNu5unYVLKxmo0kGaY='
WHERE
key_id = 'c088aeae53a456a662b16c61e57e3e9ac8e86372ed3e0df95eb86abd1d72cf84'
AND (
token = '0nyf6/szuGy41YIeuuWciqVlTHNu5unYVLKxmo0kGaY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)