UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Vw9uWxHv5q6ROGdzjKRG9r3GTfDe3Fdm9CeOzCeP2/E='
WHERE
key_id = 'af67d48c1e8bd1de5c1bc8ba49649bef403fa62bf8a055f3e2cbd8b0ae4b003e'
AND (
token = 'Vw9uWxHv5q6ROGdzjKRG9r3GTfDe3Fdm9CeOzCeP2/E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)