UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7G+TOT+5XklzA8PH1XRfsBaLTLI2cWmjVNsmq6zN7Jk='
WHERE
key_id = 'b74b03dd7d950c50fb27a1555e2e82567409d44b070af84735576ac0b34c3cc2'
AND (
token = '7G+TOT+5XklzA8PH1XRfsBaLTLI2cWmjVNsmq6zN7Jk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)