public static function expire($expiredrequests) {
        global $DB;

        $ids = array_keys($expiredrequests);

        if (count($ids) > 0) {
            list($insql, $inparams) = $DB->get_in_or_equal($ids);
            $initialparams = array(api::DATAREQUEST_STATUS_EXPIRED, time());
            $params = array_merge($initialparams, $inparams);

            $update = "UPDATE {" . self::TABLE . "}
                          SET status = ?, timemodified = ?
                        WHERE id $insql";

            if ($DB->execute($update, $params)) {
                $fs = get_file_storage();

                foreach ($expiredrequests as $id => $userid) {
                    $usercontext = \context_user::instance($userid);
                    $fs->delete_area_files($usercontext->id, 'tool_dataprivacy', 'export', $id);
                }
            }
        }
    }