Not to say continuity is perfect or anything, but haven't there been a couple of episodes with flashes of OLD Ted, Marshall, Lily, etc? Can't remember the episode, but there were together on a porch for at least one bit I recall. Thought they all appear older than Ted does in the most recent viewings with the Mother. Of course she didn't appear, as it was before this season.
Someone looked it up earlier and confirmed that the scene you're thinking of takes place in 2020 (four years before this flash-forward takes place.) Ted, Marshall, and Lily are "eating a sandwich" at their college reunion in "How I Met Everyone Else," (episode 305) and Ted belts out "Where's my wife?"
Here's a screencap from the HIMYM wiki:
Wikipedia also has a summary of the future scenes, set in 2020:
At their college reunion in 2020, Ted is approached by a woman who tells him that she was the one he made out with at the Freshman party proving Marshall was correct (revealing that Ted and Lily met when Marshall introduced them the day after the party as Lily recalled). Later Ted, Marshall and Lily all sit down for a "sandwich" that Marshall confiscated and get high when Ted suddenly realizes he can't find his wife.
EDIT: Here are two better screencaps, from Netflix: