I am having trouble with Sbb.ch. I keep getting a message "technical error has occurred". Also it does not show a 4:54 train from Luzern to Basel - which is the first train of the day. I bought a ticket for an earlier day with no trouble.
What day of the week?
I am having no such issues, but I did not actually try to buy a ticket. Also, be sure to specify Basel EuroAirport as the destination so it includes the bus to the airport. I see that on weekends, the train has a connection in Olten, so it gets to the airport a little later. There is also a 4:21 train that will get you there a little earlier.
You can buy the ticket when you get to Switzerland. They don't sell out and I can't imagine a train that early would be crowded.