Midtown - LGA before rush hour is a 20-30 minute ride depending on exactly where you are in Midtown (East or West). So, allow 30 minutes. Presuming no bags to check, not a reason I can think of to depart prior to 4:15 AM and 4:30 AM is fine.
My only embellishment to the "don't take Super Shuttle at 2:40 AM is don't take Super Shuttle at any time, at any place, under any circumstances."
Uber will run $30-35 and at that time of day may take 3-5 minutes to arrive instead of 2-3 minutes.