Under 3 hours at MEX is definitely a stay-airside situation. Immigration averages 59 minutes, and Mexico City traffic is unpredictable - leaving the airport is not recommended.
Still too tight. Even with fast immigration, Mexico City's traffic makes the 25-40 min taxi ride risky. The city is incredible but save it for a longer stop.
Time for the Zócalo (Mexico City's historic centre), Templo Mayor ruins, and a street food lunch nearby. Taxi/Uber is 25-40 min from the airport; factor in traffic carefully.
A full Mexico City hit: Zócalo, Templo Mayor, National Palace murals by Diego Rivera, lunch in Centro, maybe a walk through Coyoacán if traffic cooperates. Budget 30-40 min each way.