The story
Images in church iconography suggest similar phrases may date back to 1515. The first attestation is from 1682, the variation to hell in a handcart is attested since 1841, and a phrase similar to to heaven in a wheelbarrow is first attested in 1618. The popularity of the variation "to hell in a handbasket" may be connected to its alliteration.
Etymology from Wiktionary, CC BY-SA 4.0.