Something like this, set the current last_activity to something like now minus 5 to 30 days for all users where the last_activity is smaller than now minus 365 days
SQL:
UPDATE `xf_user` set last_activity = UNIX_TIMESTAMP(DATE_ADD(NOW(), INTERVAL -(FLOOR(RAND()*(30-5+1)+5)) DAY)) where last_activity < UNIX_TIMESTAMP(DATE_ADD(NOW(), INTERVAL -365 DAY))