I don't mind how you played it. With people at the table commenting you have aces or an overpair in this spot I think villain might have called with JJ looking for set value, or a non ace non king flop.
He might have floated the flop with the JJ suspecting you "might have AK" and spiked a jack on the turn.
I think you folded due to the straight / two pair combos but I think in a lot of spots here villain would show up with a set of jacks. I suspected he might have pocket 10's but I can't see him calling the turn with a gutshot after the overcard hits.
Either way, you were beat and I don't think if you played it any differently you would have gotten villain off his hand. I think the river 9 was a blank and you were crushed on the turn.
Any laydown that saves you money is a good one, so good laydown