Vernazza to Milano Centrale to Malpensa by Train

Greetings We are finishing our Italy trip in Vernazza. From there we will take a train to Milan and fly out of Malpensa. It's easy enough to get a train from Vernazza to Milan Centrale. I'm assuming I can purchase the ticket from Centrale to Malpensa once we arrive at the train station in Milan? I've tried online, but it isn't booking out to June. It looks like they go a couple times an hour? We are coming in late (20:00) so need a train after that. Also--any hotel recommendations near Milan Malpensa? We will stay overnight and then fly out the next morning. Thanks