UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'g2dkrCdsAJKzzTnmUCLPdJDnDjBDDv6zX7k4ygwi4s4='
WHERE
key_id = '89bfec729535a719a7660df612c09aed7d55fc6b3bf2f1f45d9e13de13faa4a7'
AND (
token = 'g2dkrCdsAJKzzTnmUCLPdJDnDjBDDv6zX7k4ygwi4s4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)