I did this turnaround in early May. You go through full immigration and customs at CUN, and the lines can be very long. We arrived at the same time as a couple of widebodies from the UK (Thomas Cook charters) and the customs hall was a total zoo. All bags are x-rayed as you leave customs, hence the queues. You then have to leave the building physically and re-enter the departures side.
My outgoing from MIA was delayed so my anticipated 3-hour turnaround morphed into 90 min. I got to the departure gate just as they were calling my flight. Way too close for comfort.