UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CrVeTeYdL3O6sY29oCtVzgJA1KfR+uKks/xEqIdn9WI='
WHERE
key_id = '61af92a13435920209df2e1cc2e9bf0105407856dd1ff2d04bc65b7c82737794'
AND (
token = 'CrVeTeYdL3O6sY29oCtVzgJA1KfR+uKks/xEqIdn9WI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)