Hi,
This tune was written in 1968 by Dominic Frontiere as the soundtrack of the movie Hang ‘Em High.
It became a hit in the version of Booker T. and the M.G.’s.
Hang ‘Em High (Booker T- and the M-G- ‘s) - Dominic Frontiere
https://youtu.be/La7f8XnA9Bk?si=00NWpR4Xm4003WVN