Get to the airport 1.5 to 2 hours prior to the flight time. Budapest is a fairly easy airport.
The counters usually, not always, open 2 hours prior. Depends on the airline. I take early flights often, if it were me, I would have the taxi pick me up for the trip to the airport 5:00 am. That is 40 minutes to the airport (from the Opera House) so you will be there at 5:40; and thats 1:40 preflight (did I do my math correctly? Check me). I would use CityTaxi and book it with their app the night before. Then I will bet you that they show up 10 minutes early; meaning you are even earlier to the airport than the math. Of course if you are the type that worries, cant blame you for that in a new city, then start at 4:45.
Dont know which airline you flying so dont know which terminal you ticket counter is in, but while they call it two terminals its really two ticket counter rooms and one big departure hall shared by both. BUT, if you ticket counter is in 2A and if after checking in you find that the security line is not open, look to the left and you will see a sign to another security line at the end of a very long, very narrow hall. Thats the hall to terminal 2B. That security always opens early (so far). Both security lines dump into the same departure hall so it really doesnt matter which you use. Your flight I will bet money is out of 2B because thats were the non-Schengen flights leave from.
O'Learys generally opens by 5am, has pretty decent breakfast. Its located in the departures hall, upper level at the 2B end of the departures hall. They have gate / flight screens so you can keep an eye on things. Passport control will take you about 5 minutes if that long. The walk to the gate 5 minutes if that long.