Button State save, 2 buttons?

Does the first button have to remain pressed until the second one becomes pressed or can the first one be released but be "forgotten" 5 seconds later ?