UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1NNGt3LV4n2rII/6mUtxnMKXRXTJBFVKlVuIRUckjrg='
WHERE
key_id = '206773b82cd215d10ae06741f37e26995bc64938cfe6ff446529f6242118f264'
AND (
token = '1NNGt3LV4n2rII/6mUtxnMKXRXTJBFVKlVuIRUckjrg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)