Sonar: Move constants to a class or enum
Personally, I do not see the reason why this needs to be a variable in the first place. If I were you I would either move this into the @Query annotation or better yet I would create a @NamedQuery under your Task entity class.
Also on a side note, I would avoid naming the repository method deleteTaskById as this name implies that a matching object will be deleted from the database. Since this is not the case here, I would rename the method to markTaskAsDeleted to avoid ambiguity.