To the purist, the second is correct. The past subjunctive of BE is were in all persons, and the subjunctive is the correct form in such hypothetical situations. However, for many native speakers, especially of BrE, the subjunctive is now dead.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.