Fixes #3468 - Move token expiry to scope to avoid FK issues

(cherry picked from commit 585f328e6bbe9e8f429ddb2ccc97fb119da959b7)

Conflicts:
	app/models/host/managed.rb