UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2wa6zlQWMukaEk+DiImTgPPVtDXAguyr0rSREQYHMos=' 
WHERE 
  key_id = '8e2b980ccff011117ff7bc88f3372863c4259fa3201e4a5ae84b211968e5d729' 
  AND (
    token = '2wa6zlQWMukaEk+DiImTgPPVtDXAguyr0rSREQYHMos=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041