24 Minutes is the twenty-first episode of Season 18. It aired as part of the one hour season finale, alongside the episode "You Kent Always Say What You Want". It was originally promoted as being the 400th episode, but aired as the 399th. It is an obvious parody of the TV series, 24, and even contains Jack Bauer and Chloe O'Brian from the TV as guest stars on this episode.
An expired and highly pungent container of yogurt at the Springfield Nuclear Power Plant is found and belongs to Homer, who is ordered to dispose of it by Mr. Burns. After failing to persuade Apu to take it, the yogurt falls into the hands of the bullies. Homer then unwittingly uncovers Milhouse spying on the bullies, causing the bullies to throw them both in a dumpster.
Meanwhile, Marge forgets about the bake sale, and only has half an hour to make a raisin sponge cake. She finds out that she hasn't got any raisins, forcing her to drive to the shop. But there's only one box of raisins and to get it, Marge has to fight with Helen Lovejoy, ending up knocking her down (Helen is injured badly enough to have to go to hospital). Marge gets the raisins and buys them. Back at home, she starts baking. In order to save time, she drastically increases the oven temperature to 1,200 degrees, 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. She accidentally drops the cake when getting out of the car (which makes it fall onto the car hood, denting it, and eventually the ground). 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, Jimbo's sister's retainer case, 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, Lisa suggests that Bart help them, which he does after negotiating immunity from punishment for all his past and future pranks. Bart breaks in to Jimbo's house but can't navigate through the house properly since the only schematics he was given was a drawing Jimbo made of his house in the second grade (including made up rooms such as a roller coaster room and shark tank). During his investigation, Bart finds the door to the basement and comes across their set up showing the tests they had done including using Ralph Wiggum 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 of 24 and turns it into a prank call against him. After finding out about the stink bomb, Bart returns to the school to tell Lisa, but is knocked out by Martin, who turned out to be the bullies' mole.
At the bake sale, the bullies start the three-minute timer for the bomb. Bart, locked in the ventilation room with Groundskeeper Willie, wakes up and contacts Lisa by his cell phone and shows her a picture of the stink bomb, telling her to have Principal Skinner dump the hot dog water and short circuit the ventilation fan. Skinner fills up the room with the water. Only for Bart and Willie to float because of the wooden chairs their sitting on, but then realize that before the water would be able to cause a short circuit, they'd both be shoved head first into the fan. Running out of time, Bart attempts to swim out, but cannot break through the room's only window. Sideshow Mel notices Bart under water 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 him, breaking the glass by throwing her burnt and incredibly solid cake through the window flooding the gymnasium. Lisa then arrives and defuses the bomb (which turns out to have a rather simplistic off switch), saving the bake sale from the stench. However after that, Jack Bauer & several CTU field agents break inside the bake sale, destroying it, and start to arrest Bart for his prank call. A nuclear bomb then goes off in the distance, but everyone sighs with relief after Bauer reassures them that the nuclear bomb went off in Shelbyville.
An original idea saw Edgar Stiles from 24 appearing in the episode and being killed, but the concept was dropped. Lisa told Bart that Jimbo drew a picture when he was a kid, and got a frowny face from the teacher.