UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ip3bE1EUaYUOvyrqtMNuPwl2bD4n+7x0OLhV0rBd2cA='
WHERE
key_id = '88341526a12eb5631c274012dc357742c5ebded23a4eaac48aed9685e3be1dea'
AND (
token = 'Ip3bE1EUaYUOvyrqtMNuPwl2bD4n+7x0OLhV0rBd2cA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)