UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YpF3IiqM4DvmJq/klQnwQuOWVuVFE/oaWH5Mkt8Ojns='
WHERE
key_id = '8ae5b066e8ca3c2ab2762b4aa8c461afd1fc6cd47ab61c2659b87bb7d383efa9'
AND (
token = 'YpF3IiqM4DvmJq/klQnwQuOWVuVFE/oaWH5Mkt8Ojns='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)