Psalm 22 is ascribed to King David who ruled around 1000 BC.  It certainly pre-dates the crucifixion - it was well known in Jesus’ day, and Jesus quoted it on the cross.  The Psalmist writes from the point of view of someone hanging on a cross, surrounded by people who pierced his hands and feet and who gambled for his clothes, yet was confident that after his suffering he’d be highly rewarded. https://www.biblegateway.com/passage/?search=Psalm+22&version=NIV