Lockhart was the city clerk in 1836 and 1837 and the prosecuting attorney of Vanderburg County, Indiana 1841-1845. He served as judge of the fourth judicial district from 1846 until 1851, when he resigned. He was a delegate to the Indiana constitutional convention in 1850.
Lockhart was elected as a Democrat to the Thirty-second Congress (March 4, 1851-March 3, 1853) but was not a candidate for reelection in 1852 to the Thirty-third Congress. After leaving Congress, he resumed the practice of his profession in Evansville, Indiana. He was appointed by President Franklin Pierce superintendent of construction of the marine hospital at Evansville in 1853. He was elected to the Thirty-fifth Congress and served from March 4, 1857, until his death in Evansville, Indiana on September 7, 1857. He was buried in Oak Hill Cemetery.