I want to speed-up some scripts, so my question is:  
**Is there a faster available solution for this?**

uid are just IDs which are added to a temporary table.  

After that it updates the origin table with the given uid's.

Engine is InnoDB, MariaDB 10.0.19.

It takes approx 20s for ~400 entries.

```
CREATE TEMPORARY TABLE cleanup_users AS (
    SELECT uid FROM users
    WHERE FROM_UNIXTIME(last_connect) <= DATE_SUB(NOW(), INTERVAL 2 MONTH)
    AND activity <= 20 AND hide != 1
);
UPDATE users SET hide = 1 WHERE uid IN (
    SELECT * FROM cleanup_users
);
DROP TABLE IF EXISTS cleanup_users;

```