lines = [line for line in open('text.txt') if {'|E|', 'GetPastPaymentInfo'}
    .intersection(line.split()) and not {'CheckData', 'UpdatePrintStatus'}.
    intersection(line.split())]
Python multiple condition IN string