Yes; only the edit needs to be within 12 hours of the answer. The moment of the upvote (actually, the score being > 0) doesn't matter.
Let's say that you answer something, and:
You edit the question 12 hours before or after answering it. This allows you to edit now, answer later — or answer now and edit later, when you have the time.
Your edit isn't ...