Walking using a shopping cart causes you to flex at your lower back and support some of your torso weight on the cart itself. This has two effects. One, of course is that the spine is partially unloaded (less stress loading on the spine). Less load on the spine reduces compression and shear forces which reduces pain.
The other action that forward flexion produces is opening of the central canal and foramen as well at loading anterior structures and reducing load on posterior structures. If the painful structures are posterior (pars fractures or facets), forward bending reduces stress on them. If there is stenosis (narrowing) of the central canal or foramen, this action will also open the channels that transmit the nerves.
Donald Corenman, MD, DC is a highly-regarded spine surgeon, considered an expert in the area of neck and back pain. Trained as both a Medical Doctor and Doctor of Chiropractic, Dr. Corenman earned academic appointments as Clinical Assistant Professor and Assistant Professor of Orthopaedic Surgery at the University of Colorado Health Sciences Center, and his research on spine surgery and rehabilitation has resulted in the publication of multiple peer-reviewed articles and two books.