UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OHfuV+EfI6XWNIYQO2PLfCr5zjOg7OYy5maXolFumYY='
WHERE
key_id = '49c9e8933ee37fe41f70fc9fc86383f736e9740fc1a03b3c70fe160ac369cc35'
AND (
token = 'OHfuV+EfI6XWNIYQO2PLfCr5zjOg7OYy5maXolFumYY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)