Lot of good advice in this thread; the fold was probably the best call.
Also, slightly different from the direct answer of your question, but another idea to consider:
Any time I lay down rags that turn into a monster (at least twice I've seen my 47o turn into a straight, or 27o turn into a full house) I try my best to let it go...
... when I can't, I tell myself: Chances are that someone in the circle, on the pot I won with everyone folding out to my AKs draw, laid down their 45o pre-flop with 2-3-6 rainbow...
... so, when I miss what would've been a sweet set, such as the trip A's mentioned above, I coax myself out with that reminder, and knowing there is a more premium hand around the corner.