Found a solution
to add to the file functions.php before ?>
this code
function cust_all_premiums_ontop_random() {
$mSearch = Search::newInstance();
$query_elements = (array) json_decode($mSearch->toJson());
$mSearch->addField(sprintf("(SELECT RAND() FROM %st_item i2 WHERE %st_item.pk_i_id = i2.pk_i_id AND %st_item.b_premium = 1) AS rand_premiums", DB_TABLE_PREFIX, DB_TABLE_PREFIX, DB_TABLE_PREFIX));
$mSearch->order("rand_premiums DESC, " . $query_elements['order_column'], $query_elements['order_direction']);
}
osc_add_hook('search_conditions', 'cust_all_premiums_ontop_random');