How can I modify a user's last access date using Rules?
Two options:


Just as you said, a custom rules action:

function MY_MODULE_rules_action_info() {
  return array(
    'MYMODULE_action_update_last_access' =&gt; array(
      'label' =&gt; t('Update last accessed timestamp'),
      'group' =&gt; t('Custom'),
      'access callback' =&gt; 'rules_user_integration_access',
      'parameter' =&gt; array(
        'account' =&gt; array(
          'type' =&gt; 'user',
          'label' =&gt; t('User'),
          'description' =&gt; t('User account whose last accessed timestamp will be updated.'),
        ),
      ),
    ),
  );
}

function MYMODULE_action_update_last_access($account) {
  // There might be another way to update the last accessed date, but you can
  // also do it directly in the database.
  //
  // NOTE: the code below will update the last access to current timestamp.
  // You could also do something like this, to get a random value in the last
  // 24 hours:
  //    $timestamp = rand(REQUEST_TIME - 24 * 60 * 60, REQUEST_TIME);
  $timestamp = REQUEST_TIME;
  // Update the data in database.
  db_update('users')
    -&gt;fields(array('access' =&gt; $timestamp))
    -&gt;condition('uid', $account-&gt;uid)
    -&gt;execute();
}

Use hook_cron() implementation in a custom module. This can be cleaner if you don't need to configure this more than once.

function MYMODULE_cron() {
  // Decide how often you want to do this, e.g. daily, weekly, etc.
  // Below is an example for daily trigger.
  $last_updated = variable_get('MYMODULE_var_last_time_access_updated', NULL);
  if (!$last_updated || $last_updated != format_date(REQUEST_TIME, 'custom', 'z')) {
    // Define user IDs which need to be updated.
    $accounts_to_update = array(1, 2, 3);
    // Update them.
    foreach ($accounts_to_update as $account_to_update) {
      // See #1 above; I'll use a random timestamp in last 12 hours this time.
      $timestamp = rand(REQUEST_TIME - 12 * 60 * 60, REQUEST_TIME);
      // Execute the query.
      db_update('users')
        -&gt;fields(array('access' =&gt; $timestamp))
        -&gt;condition('uid', $account_to_update)
        -&gt;execute();
    }
  }
}