An expired and highly pungent container of yogurt at the Springfield Nuclear Power Plant is found by Homer, who is ordered to dispose of it by Mr. Burns, a task Homer is all too eager to do as he considers it a "business trip". After failing to persuade Apu to take it, the yogurt falls into the hands of the bullies. Homer mistakenly uncovers Milhouse spying on the trio, with the bullies locking both of them inside a dumpster.
Meanwhile, Marge only has half an hour to make a raisin sponge cake for the bake sale. Upon arriving at the supermarket to find some raisins, she finds that there is one box left and must fight Helen Lovejoy to retrieve it, which Marge ultimately succeeds. Back at home, Marge drastically increases the oven temperature to 1,200 degrees in order to save time, burning the cake and making it rock-solid. Marge attempts to cover it up with pink and white frosting before leaving for the bake sale, but accidentally drops the cake when getting out of the car, denting the hood. She can't repair it, so she just pats a bit of the icing flatter. Not surprisingly, no one tries to eat any of the cake at the bake sale.
At Jimbo's house, the bullies make a powerful stink bomb from the expired yogurt (referred as TCBY) (along with other ingredients such as roadkill, burnt hair, a retainer case owned by Jimbo's sister, six weeks of bottled farts, possum placenta and sweat from a walk-around Goofy-suit), and plan on detonating it at the bake sale. After Milhouse's failed attempt to track the bullies due to Homer unknowingly blowing his cover, Lisa suggests that Bart help them, which he does after negotiating immunity from punishment for all his past and future pranks, as well as teaching him a swear word he didn't already realize. Bart then steals Skinner's car to locate Jimbo's house. Jimbo later gets a call from Martin, warning the trio that the CTU is onto them and they must leave as soon as possible. Bart breaks into Jimbo's house but can't navigate through the house properly as the only schematics he was given were a drawing Jimbo made of his house in the second grade (including made-up rooms such as a roller coaster room and a shark tank). During his investigation, Bart finds the door to the basement and comes across their setup, showing the tests they had done, including using Ralph as a test subject.
When trying to contact Lisa and tell her what he had found, Bart's phone call is accidentally crossed with a call from Jack Bauer, whom Bart takes the opportunity to prank. After finding out about the stink bomb, Bart returns to the school to tell Lisa, only to find that Martin was acting suspiciously (namely skipping and singing "Skip To My Loo"), and then proceeded to interrogate Nelson (who was in close proximity and didn't think it suspicious) by slamming a garbage pail over his head and beating it to find out whether Martin was a mole. Upon getting confirmation from Nelson, Bart then immediately calls Lisa and attempts to warn her that the bullies had a mole within the CTU. Before Bart can expose the name of the mole, however, he is knocked out by Martin.
At the bake sale, the bullies start the three-minute timer for the bomb. Martin gets his ant farm back from the bullies (the sole reason why he acted as the mole), although one of the ants "joined the bullies", with Martin being ominously escorted out of the room. Bart, locked in the ventilation room with Groundskeeper Willie, wakes up, calls Lisa and shows her a picture of the stink bomb, telling her to have Skinner dump the hot dog water and short circuit the ventilation fan (with Willie telling Bart what the valve was). Skinner fills the room with the water, only for Bart and Willie to float because of the wooden chairs they are sitting on. They realize that before the water is able to cause a short circuit, they will be shoved head first into the fan blades. Running out of time, Bart attempts to swim out, but is unable break the room's only window. Martin then realizes the full ramification of his actions, and proceeds to give himself a "self-wedgie". Sideshow Mel notices Bart underwater through the other side of the window, and Chief Wiggum tries to shoot through the glass (accidentally aiming at Bart's face each time), only to learn that the glass is bulletproof. Marge helps Bart, breaking the glass by tossing her solid cake at the window and flooding the gymnasium. Lisa then arrives and powers off the bomb, saving the bake sale from the stench. However, Bauer and several CTU field agents burst into the gym and prepare to arrest Bart for his prank call. A nuclear bomb then goes off in the distance, but Bauer reassures everyone that the bomb went off in Shelbyville.
Behind the Laughter
An original idea saw Edgar Stiles from 24 appearing in the episode and being killed, but the concept was dropped.
Robert Canning of IGN named "24 Minutes" the best episode of the season, calling it a "smart, funny, spot-on parody" that "came very close to redeeming the entire season".