Taylor Lamb passed for 225 yards and two touchdowns and added 46 yards rushing and another score for Appalachian State (5-5, 4-2 Sun Belt), which has won four in a row.
Appalachian State trailed 20-6 midway through the second quarter, but Lamb hit Shaedon Meadors for a 24-yard touchdown with 4 seconds left in the half, the first of 31-straight points for the Mountaineers.
Cox rushed for 53 of Appalachian State's 68 yards on a touchdown drive to open the second half.
After Arkansas State went three-and-out, Cox scored on a 14-yard run, giving the Mountaineers a 27-20 lead they wouldn't relinquish.
Fredi Knighten threw two of his three touchdown passes in final 2:17, but Arkansas State (6-4, 4-2) couldn't complete the comeback.