UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fpA3Dl5F4JRW6SO/cjUJeQTUwPvi45DC+hoA9zfowHE=' 
WHERE 
  key_id = '7e2ce524996dbb2243faddf53a4efe325ae3edf1d44283757d18d2c396c3ac51' 
  AND (
    token = 'fpA3Dl5F4JRW6SO/cjUJeQTUwPvi45DC+hoA9zfowHE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032