UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OuOp05lEZDMqu7ewWCMUolA/W7cgrGasbwwhYHwwDaU='
WHERE
key_id = '10647abbcd7c5778a3e790f99e6338dc6c7b1f6dabada958ca1209ea996ccc11'
AND (
token = 'OuOp05lEZDMqu7ewWCMUolA/W7cgrGasbwwhYHwwDaU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)