REPLACE INTO nyse_user SELECT CURDATE(),id,status FROM users LEFT JOIN user_cookie ON id=user_id AND invalidated_from IS NULL WHERE status <> 'immune' AND (valid_exchanges & 24) AND cookie_valid_start > CURDATE() AND authorization_expires > now();
