UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9opbQI+urA2aaPyElPOZ5XeurNkte5LOMfl/Ko/4wSM=' 
WHERE 
  key_id = 'bc6e428aba634f6f0ab4eaaafe5e420915378486e53e7c76d95a1c32ffd6d176' 
  AND (
    token = '9opbQI+urA2aaPyElPOZ5XeurNkte5LOMfl/Ko/4wSM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032