In recent years, LPWAN technology, designed to realize lowpower and long distance communication, has attracted much attention. Among several LPWAN technologies, Long Range (LoRa) is one of the most competitive physical layer protocol. Long Range Wide Area Network (LoRaWAN) is an upper layer protocol used with LoRa, and it provides several security functions including random number-based replay attack prevention system. According to recent studies, current replay attack prevention of LoRaWAN can mislead benign messages into replay attacks. To resolve this problem, several new replay attack prevention schemes have been proposed. However, existing schemes have limitations such as not being compatible with the existing packet structure or not considering an exceptional situation such as device reset. Therefore, in this paper, we propose a new LoRaWAN replay attack prevention scheme that resolves these problems. Our scheme follows the existing packet structure and is designed to cope with exceptional situations such as device reset. As a result of calculations, in our scheme, the probability that a normal message is mistaken for a replay attack is 60-89% lower than the current LoRaWAN. Real-world experiments also support these results.