ignore the guys who say take pills or eat this or whatever.
firstly have a think about what is happening. it sounds like from your description that you had a bad punt, and that this has caused a little psychological switch in your thinking. so you had a bad day, and then this probably raised doubts in your mind when you next went for a punt. now as the 2nd punt went on you proabbly thought something like... what is happening to me, what is wriong with me, why cant i get an errection... etc etc this anxiety and worry then will have exacerbated the problem.
i have had similar experiences myself on 2 periods of my life. once when i was early twenties with girlfriends. it lasted until i got a steady girlfriend and then i was relaxed enough to just work through it. it just took 1 session for me when i was relaxed and there was no time limit, and then i got hard again. after that i didnt have any more trouble for over a decade.
recently i saw an EE girl and had a shit punt. she was one of those who the situation wasnt ideal when i got there (2 girls in hotel room, not girls in photos, i felt ill at ease etc etc) then she wanted to give me a shit 1 min blow job, put a jonny on and ride me. i felt under pressure and tho i managed to get hard enough to put on a jonny and shag her, it was pretty pathetic and i thought i would go soft all the way thru it.
next punt again an EE and the worry was there again, this girl was really hot (cheryl cole lookalike), really friendly, but a bit rushed. i couldnt get anything going thru the BJ, so i asked her to stop and i went down on her until i was hard. this took the pressure off me, and its somethign that turns me on anyday of the week. i got hard enough to put on a jonny and once i was fucking her it was back to normal. again no problems since then.
so with me it is more of something in my mind. if i have a bad punt, or i get doubts about my ability, then the stress has in the past caused me troubles. however, once i;m over the bump, its back to normal for me.
i would recommend that if you have a girl who you've seen before and feel relaxed with, and ideally can have a laugh with... go to her for a 1 hr or 2 hr session and just get up to rudeness with her. don;t put loads of pressure on yourself to come, you could just aim to give her a great time with oral or whatever takes your fancy. get her to give you a sexy massage or bath/shower, whatever. have it in your head that its OK to have sex, but it's OK not to have sex too. this will take the pressure off and in time your mind will switch back.
if you start taking med or whatever you could start to think you need them and this can just complicate your thinking.
obviously for some guys of a certain age or whatever, drugs are a great fix for them. but certainly it sounds a bit soon to be diagnosing yourself as having ED problems