Is "no more than 10 years experience" more illegal than "at least 5 years experience"?
At least 5 years experience is a requirement that is job related. You need 5 years of experience at X do lead others doing X.
No more than 10 years experience seems very much not job related. How does having too much experience hurt a person's ability to do a job?
It's simple. People who have more experience generally demand higher salaries. The company in question is probably seeking someone who's fairly experienced but doesn't have the budget to afford a superstar.
So then you put an "up to" salary number in the ad.
Yes, it's only illegal to discriminate against people age 40 or older.