UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'R1btO9tKX68LmzueEW9CzlxtfhVf1akaWR89ta9m/v4='
WHERE
key_id = '1cf860c07b62b262ff1166b08a6078bda41046200bb89579b340e1a9a02ac56f'
AND (
token = 'R1btO9tKX68LmzueEW9CzlxtfhVf1akaWR89ta9m/v4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)