Code:
MyAddonDB.lastLogoffTime = time
Should probably be
Code:
MyAddonDB.lastLogoffTime = time()
for the
time function rather than a non-existant variable because you're not passing anything to
SaveLastLogoffTime (and if you were it would just be
time() presumably.
That and lua is case sensitive. MyAddonDb in the .toc is not the same as MyAddonDB in the code.