No, this is not illegal discrimination, and is necessary as tech in the modern era advances quite rapidly when compared to other sciences. For example, I work in the tech industry and when I started, the concept of Cloud Computing was just starting to hit the market for consumers... today, pretty much all of my work is on the company cloud (I remember when it was saved to my work station). As a general rule, Moore's Law (revised as of 1975) states that the every two years, a Computer's processing power will double (though this is not a hard constant as the rate has fallen to every 18 months and more recently every 26-30 months though it's likely to fall again soon, according to Intel). This means that more stuff can be done with less space taken by the physical machine and this opens up new avenues of use for a computer (It's also the reason why jokes about merely purchasing a top of the line computer will render it obsolete).
This is also probably for new hires as well, as the company man is probably engaged with new tech needs day in and day out, but someone who's last computer degree was in the 1980s will have a tough time understanding the tools of the trade in current year... some of the most popular languages weren't in use... or have been drastically updated to better used more powerful systems... than what the 80s degree holder has.
Finally, while age is a protected class, it's not as strongly protected as say race or religion or sex and has different level of requirement. A 50 year old and a 23 year old who both received their degree in the past 10 years are equally qualified in that regard so here, age is just a number, not a classification. As the holding of a degree is a "Merit", it's not discrimination in the eyes of the law.