UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VPv3x5LnmwbFRiuZ9Yl6qkMaPSgeOsY6IWaN1+chBCE='
WHERE
key_id = '32b9904efadae7592f9e84629fc55004dfa9dec777ee8b15fc01288f8a575ea4'
AND (
token = 'VPv3x5LnmwbFRiuZ9Yl6qkMaPSgeOsY6IWaN1+chBCE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)