The US wants to know two things—will you leave before 90 days is up and do you have an onward ticket that takes you to some place that is not Canada, Mexico, or a Caribbean island? Your two tickets would satisfy both requirements. In fact, the US says that you must have a ticket for every leg of the trip if you are leaving from Canada, Mexico, or the Caribbean.
The reality is, they don’t always ask to see proof of that onward travel. It’s even rarer to be asked for proof of every leg. However, there is one important thing for you. Does that flight from Mexico to the UK transit the US? If so, you may have a problem. The US has no transit areas in airports. You must clear US immigration and customs, even if you will be flying out two hours later. That means you would need to re-enter the US without meeting the “leave North America first” requirement.
Sometimes, if you have spent a substantial amount of time in Canada or Mexico, the US will let you in so you can catch that flight home. There is no definition of “substantial time,” and this admittance is not guaranteed. It is totally up to the immigration official. One option would be to visit a country in Central America as part of your holiday. The other, of course, is just to be sure your flght from Mexico doesn’t transit the US.
By the way, on entering, it might be a good idea to say you are visiting friends, not a boyfriend. Mention of a romantic attachment is a flag to immigration that you might overstay and/or try to work illegally.