UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7WLTHynxazYYT7zHl6LXXJ1xO7RnQtyZvU3B3rrs21I='
WHERE
key_id = 'b3650bccfbb5f6071a34bd3e547dd31e09567b82de76ae201bc0cf121dc8392e'
AND (
token = '7WLTHynxazYYT7zHl6LXXJ1xO7RnQtyZvU3B3rrs21I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)