On domainreg box, in /etc/domainreg.conf for each tld, expiration command can be defined as following:
Option autoexpire_offset_days = 0 tells domainreg when to send an expiration command
if domainreg doesn't receive renew command (when renewal invoice is not paid, for example) and If a value set for autoexpire_offset_days is 0, then expiring of a domain will be done on an expiration date.
If this value is bigger than 0, then expiring will be done that amount of days after expiration date.
If it's less than 0, then it will be done that amount of days before expiration date.
In order to autoexpire_offset_days work, a periodic task must be turned on because that's where the logic is implemented. To turn on periodic task, there should be this config option in <tld> element:
periodic_registry_plugin_task = 1
Also, there needs to be a connection which handles periodic, so within the <tld>, there should be a <connection> element with following in it: handles and periodic