If you were invited to resubmit, you can. Unless this invitation was conveyed to you with an explicit deadline, your waiting on it should not be problematic.
However, if you resubmit to the same journal after 31 months, then although you should call attention to the fact that you were invited to do so, you should not expect to get any advantage or economy from this. In my experience journals and editors keep papers "in mind" for a certain, smaller length of time, after which they can forget pretty thoroughly. (For that matter, 31 months is plenty long enough for the editor who handled your paper to no longer be working for the journal.) You cannot count on getting the same referee(s). On the other hand you might, which is something to keep in mind if there was something negative in the original referee report.
What I would advise is to reflect on whether this is the best journal to submit your paper. If you feel strongly that it is, then resubmit there. If you weren't sure whether that journal was such a great choice and/or submitted there more or less randomly, I would try again with a different journal. I have had the experience of submitting a paper to a journal, having it rejected, writing back later to the editor explaining that I was able to get the results the referee asked for, and the editor said, "OK, then why not resubmit?" The paper went back to the same referee, who forgot about it, and then when reminded decided it still wasn't good enough. Now I might have gotten the same referee at a different journal, but still: annoying! In general I feel that once a journal has rejected your paper, it's safest (even psychologically) to take future incarnations of the paper elsewhere.