The only (obvious) problem with that is that law will never be passed by a self-interested Congress.
Also, it might be unconstitutional because the only qualifications for Congressional Office are set within the Constitution. This would be similar to term limit legislation and the Supreme Court has ruled that States cannot enforce term limits on their federal Congressional representatives because the U.S. Constitution controls.
Would probably take a Constitutional Amendment.