diff --git a/typo3/sysext/install/Classes/Updates/PopulatePageSlugs.php b/typo3/sysext/install/Classes/Updates/PopulatePageSlugs.php
index 20ce51548a6c27386d211bad6f01dbdadf693419..2f083e66f6a361d058047d3253c160048a0e4368 100644
--- a/typo3/sysext/install/Classes/Updates/PopulatePageSlugs.php
+++ b/typo3/sysext/install/Classes/Updates/PopulatePageSlugs.php
@@ -233,7 +233,7 @@ class PopulatePageSlugs implements UpgradeWizardInterface
                     $queryBuilder->expr()->gt('expire', $queryBuilder->createNamedParameter($currentTimestamp))
                 )
             )
-            ->orderBy('expire', 'DESC')
+            ->orderBy('uid', 'DESC')
             ->execute();
         $suggestedSlugs = [];
         while ($row = $statement->fetch()) {