Was Kazakhstan part of any particular ancient civilization like the Sarmatians or Scythians? I noticed that the latter are usually associated with what is today Russia and th Black Sea region.
What about the Massagatae? Tomyris is revered there but we don’t really know where she was born.
I’ve read about the Kazakh Khanate but I was interested in the ancient history of what is now Kazakhstan. Who lived there before and so on. Does anyone have any book recommendations on this topic?
Ancient Kazakhstan history is a bit outside my area of expertise, but yes, Kazakhstan very much hosted ancient civilizations like the Scythians...and the Scythians themselves!
It's worth keeping in mind that while steppe peoples like the Scythians, Sarmatians and Khazars might be associated with the Black Sea area or southern Russia, the Pontic Steppe is more or less continuous with the Caspian Steppe, so these peoples would have also inhabited what is now northwestern Kazakhstan as well.
I am not very familiar with the Messagetae but they definitely were in the Caspian-Aral region, and within modern-day Kazakhstan.
The other ends of Kazakhstan tend to be associated more with nearby border regions, so northeastern Kazakhstan is closely associated with the Altai area (and Mongolia), while the southern parts include the Syr Darya area (Jaxartes in classical sources), and the Semireche/Mughulistan area in the southeast.
These southeastern areas in particular hosted the Sakas, and the kurgans dotting the Issyk district have been studied by archaeologists since the 1960s.
The "Golden Man", recovered from a Saka kurgan in Issyk, has even become something of a national symbol for the modern state of Kazakhstan.
There are some good books that cover the ancient history (Svat Soucek's History of Inner Asia and Christopher Beckwith's Empires of the Silk Road come to mind), but specifically on the Kazakh khanate and its interest in ancient history, I'm not sure you will find much - mostly because I doubt there is much there.
Most of the interest in the Sakas and Scythians in the region comes from archaeology that mostly started under the Soviets, and connection with the Sakas matters more to the building of modern Kazakhstani national identity than it would have to members of the Kazakh khanate in the 15th century, who mostly relied on oral traditions and creation myths to explain their place in the world (so you'd be more likely to hear from them that they were descended from a white swan than from Bronze Age Sakas).