How to keep device id updated while using push notification

I am using push notification plugin. At first time when it register a device it return a device id . As google change device id after some time then how can I keep device id updated at my server?