UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QVJlNoEXic7UPKgW3SOFNbVG7PjHQlHNDRfwiGWSo2s='
WHERE
key_id = 'c9483c7c8d637e92b5ed09a9441fa3afb5e8bc8a256faacdec7b4627002a09e9'
AND (
token = 'QVJlNoEXic7UPKgW3SOFNbVG7PjHQlHNDRfwiGWSo2s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)