UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oriok9UK2sZW2Q5ufDoGLqm46DTF+Kbt5ZD1JoS2IZ4=' 
WHERE 
  key_id = 'a094c24f8697c7342f6c4679229ad5caf36f59f70a6f15c2412b817620f937b5' 
  AND (
    token = 'oriok9UK2sZW2Q5ufDoGLqm46DTF+Kbt5ZD1JoS2IZ4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026