UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'M0X6+NjWW06Ur0S+eBMUsRzkizMTpnbpaYyhlxCMyPU='
WHERE
key_id = '88cfc01c0e62456eb40d3911775c65f03741b9b4cd123869ebdff247d2d62e72'
AND (
token = 'M0X6+NjWW06Ur0S+eBMUsRzkizMTpnbpaYyhlxCMyPU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)