Messi handed his side the lead after he both won and converted a penalty, bringing up another milestone in his career.
Messi netted from the penalty spot in the first half for his 116th career goal in the competition, before the lively Ansu Fati added a second.
Philippe Coutinho grabbed another goal early in the second half but Barca defender Gerard Pique was dismissed for impeding Tokmac Nguen, leading to a penalty for the visitors that was converted by Igor Kharatin.
Any thoughts of a dramatic comeback were quashed though as 17-year-old Pedri netted his first Barca goal after arriving from second-tier Las Palmas at the start of the season, and Ousmane Dembele added the fifth late on.
Former Manchester United winger Ryan Giggs is the only other player to net in 16 Champions League seasons, though the run was not consecutive.