What is the lease time for your dhcp server? Is it 40 minutes?
/ip dhcp-server print
I will presume it is, since I have seen this before on my dhcp server. Here is what I used to determine the problem, which I have yet to solve, but your input may help. What I found is when the client renews the lease, sometimes the dhcp server is not resetting expires-after in the lease. This seems to be client device dependent. If it renews ok the first time, it will always renew ok. If it fails to reset expires-after the first time, it will always fail.
Do the system logging first, then go to the log and watch the dhcp server transactions with the "print follow" command below.
When you see your device renew the lease, go to "/ip dhcp-server lease". See if it reset the expires-after to 40 minutes, or did it leave it at a little less than 20 minutes? The last-seen time and the expires-after time should total the lease time (40 minutes?). My faulty router (on a renew) will not set the expires-after on certain devices only. The last-seen and expires-after totaled a few seconds less than 20 minutes after the renew, not 40 minutes as I expected. The bad part is the dhcp server tells the client it is good for another 40 minutes, so renew a little after 20 minutes. You will see this in the ack packet: Address-Time=2400
add topics=dhcp,debug action=memory
print follow where topics~"dhcp"
/ip dhcp-server lease
Your input would be most helpful.