diff --git a/src/model/Stats/StatsRepository.php b/src/model/Stats/StatsRepository.php
index <HASH>..<HASH> 100644
--- a/src/model/Stats/StatsRepository.php
+++ b/src/model/Stats/StatsRepository.php
@@ -41,9 +41,9 @@ class StatsRepository extends Repository
 
     public function updateKey($key, $value)
     {
-        $this->getTable()
-            ->where(['key' => $key])
-            ->update(['value' => $value]);
+        $this->getDatabase()->query(
+            'INSERT INTO stats (`key`, `value`) VALUES (?, ?) ON DUPLICATE KEY UPDATE value=VALUES(value)', $key, $value
+        );
     }
 
     public static function insertOrUpdateQuery($key, $valueQuery)
Loading stats value from cache if not too old