How to calculate the difference in time

You may not need much of a rule for this at all. There can be many ways to go about this so first I’ll present a high level approach.

  1. Configure Expire on the Item linked to the last_updated Channel so that after five minutes it sets the Item back to something we can use to trigger a rule. Note that Expire now has the ability to only respond to changes but you need to be running 3.3 or later.

  2. Create a rule that triggers when that Item changes to the state Expire sets it to do what ever needs to be done when the five minutes is up.

After you think about it, you don’t even need the last_updated Channel. You can use the Channel that represents the motion itself potentially, depending on how that Channel works.

See Design Pattern: Motion Sensor Timer for several ways to implement this sort of thing.