UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 's3umr/nQPRTmNtlwXYbePrF0Qw2CfUejiBjbgGkn7Cw='
WHERE
key_id = '1df7953b1b27ebb7675b6406ce6e6f297b5896ab854d968d99b9303c681aa604'
AND (
token = 's3umr/nQPRTmNtlwXYbePrF0Qw2CfUejiBjbgGkn7Cw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)