No problem.
It may be illegal to buy a ticket in your state, but Congress answered your question:
It is perfectly legal to drive across the state line, buy a ticket in the other state, and drive back across the state line with the ticket in your possession.