Use built-in Entity Query pager.
Don't update imported on every save.
Remove overzealous escaping.