"The Old Man and the Key" was written by Jon Vitti and directed by Lance Kramer. It was first broadcast on the Fox network in the United States on March 10, 2002. The idea for the episode was pitched by Vitti, who was inspired by an article about senior homes. The article described senior homes as being a lot like high schools, in that there are popular and unpopular people, and that those who, for example, own a car are "like kings". Vitti suggested that the episode should be that "Grampa's life [is basically like that of a teenager", with Homer acting as if he was Grampa's father. The Souvenir Jackitos, who challenge Grampa to a death race in the episode, were conceived from an observation by the writers. The writers argued that the only ones buying expensive trademarked jackets are old people who want to appear younger.