UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'm/fWHX4J/6dSvn2XdKZApo4Sue6PxuMsIpIYeck6vu0='
WHERE
key_id = '02c9280334ba34005540c80d07a78feab98714dd7e4d4750981f3afff97bbd2d'
AND (
token = 'm/fWHX4J/6dSvn2XdKZApo4Sue6PxuMsIpIYeck6vu0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)