As the youngest employee in my workplace for about a year and a half, I can relate. However, as the youngest in most social groups I've participated in, I have a few survival strategies.
It is better to act (albeit naively) than to do nothing
In my experience, the older and (chances are, more mature) a person is, the more likely they will be accepting of someone else who is struggling to participate in a conversation. Especially, they will overlook a certain amount of naivete in someone else.
Although I wince at the idea of being considered naive by others, the reality is, as a young person, you cannot escape expressions like, "I remember when I was your age..." While this is inherently (although unintentionally) patronizing, it gives you an advantage, as well:
If I do something socially awkward, others find it unremarkable; their expectation of me is lower than their expectation of older folk; they expect me to be naive. As long as I'm not overtly disrespectful, and I'm quick to apologize whenever I blunder, chances are, they'll forget about it in an hour. (NB: Blunder in this case means that I offend or disrespect someone else; not that I say something they find uninteresting. In the latter case, look at my 3rd point.)
However, if I handle a situation with tact, it is remarkable to them, and they are impressed. Chances are, they'll remember that for a while. "Jonathan is only 25, but he handled that situation like a pro" Therefore, it is often more beneficial to act, than to be silent.
Rely on the wisdom of others
Everyone loves to give their opinion, and becoming older and more mature doesn't make this less true. If an older adult believes they have an opportunity to mentor you, or give you advice, they'll take it: and if you receive their advice gracefully (whether or not you actually take the advice!) makes them look smart — and makes you look smart, too!
Here's an example: your manager knows that successfully engaging with your colleagues socially is a big help toward being able to work with them effectively. He or she also can see how difficult it is for you to engage in the current conversation. (And that fact is not true because of your age, but in spite of it: a single person of any age would have difficulty entering into these types of discussions, without first changing the topic.)
With that assumption, chances are, your manager was simply trying to give you an opportunity to respectfully switch topics. Next time, take the opportunity. Even if you struggle, you're still following your boss's leadership: and if you follow him/her into an area that makes you seem (or be) uncomfortable, that only demonstrates your trust in his/her leadership. As a young person, you still come out ahead this way.
I should also note that, a young person who chooses not to interrupt an older person can indeed seem more mature; that, you did well; but refusing to engage at all does demonstrate your immaturity. Nevertheless, don't be discouraged by this, and don't give up: the only way to go from here is up!
If you seem immature now, it can work in your favor in a few months, when your co-workers see you growing (e.g. in this case, participating in the conversation.) There's a whole world of difference between someone who is naive and someone who is obstinate or lazy! It is much better to seem naive than lazy! This underscores my first point all the more: to a healthy limit, action is better than inaction.
Treat yourself as an equal to your colleagues
As counter-intuitive as this may sound, this is probably one of the most mature decisions I ever made, as a young adult. The reality is, you were hired. There were others who your boss could have hired; some of them were probably older than you. Your contribution to the company is already considered valuable. By extension, your contribution to your co-workers lives is valuable: when you do your job well, it helps them to do their own jobs; and if they see that you are attempting to do well, it behooves them to help you in every way that they can — for their own benefit, as well as yours.
To say it another way, Don't allow your age to become an excuse to do poorly (even by accident). You have the same expectations of yourself as they have of themselves, right? You expect yourself to do good work, so why wouldn't you expect yourself to be equal to them at the lunch table?
So what if they don't like the things that interest you? You have as much right to air your opinions as they have! (Just be respectful, and allow the conversation to drift away from your interests as quickly as it moved toward them.)
Relate to your co-workers, instead of wondering how they relate to you
The reality is, each of your co-workers has a different makeup: they have different strengths and weaknesses. How are you different from that?
In addition, their perception of their own strengths and weaknesses differs from reality, at least in some points. How are you different from that? You view your youth and inexperience as a weakness; but it can be a strength, with the right attitude. They may well view their age as a weakness.
They (may) see their lives as less exciting that yours: much of their lives is now focused around responsibilities (fixing something in the garage), which you do not have. They don't have as much time to study technology or science; they don't have the time to read books or watch shows anymore.
The adventures of a single person is often interesting to a married person. (Why else would soap operas be so popular?) Now, obviously, and unlike a soap opera: you don't want to talk about all of your adventures: like how often you date a new person, etc.
But, you can talk about, e.g. how you want to participate in bicycle marathon you've been training for, and how thrilling it is for you to ride from time to time. (I often commute by bicycle.)
So, what you contribute (even if nothing else) is a vibrancy that (they may believe) they lack.