UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'q4sH/Lzt998jBD+vqpGfRgnGuPWn+rkJkgmxrV31rHk='
WHERE
key_id = '090a4bb1d311a285d5b546b5ffffa8da353711986e58bebe2a6437a81274e4f7'
AND (
token = 'q4sH/Lzt998jBD+vqpGfRgnGuPWn+rkJkgmxrV31rHk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)