President’s term of office expires regardless of martial law or anything else. If necessary - WAIT - the Speaker of the House becomes acting President.
Paul Ryan would do it, too. They're all one big uniparty.