When he leaves office , the 80-year-old former Navy secretary will have served 30 years as a U.S. senator .