Whenever personal property which has been attached shall not have been claimed or replevied, the judge, or justice of the peace, out of whose court the writ was issued, may, either in term time or in vacation, order the same to be sold, when it shall be made to appear that such property is in danger of serious and immediate waste or decay, or that the keeping of the same until the trial will necessarily be attended with such expense or deterioriation in value as greatly to lessen the amount likely to be realized therefrom.