You'll need to check with your airline about re-booking to an earlier flight out of JFK or LGA and they may charge you a re-booking fee. There's a shuttle bus ($13) to LGA which takes about 30 minutes depending on traffic. If you are able to re-book from LGA be sure to leave enough time for ground transfer between airports.
You'll need to check with