Unix stores it's timestamp as the number of seconds since the "Unix Epoch" which is Jan 1, 1970 at 00:00:00 GMT.
MySQL stores it's timestamps as a string of values that it translates into a date and time:
TIMESTAMP(14) YYYYMMDDHHMMSS
TIMESTAMP(12) YYMMDDHHMMSS
TIMESTAMP(10) YYMMDDHHMM
TIMESTAMP(8) YYYYMMDD
TIMESTAMP(6) YYMMDD
TIMESTAMP(4) YYMM
TIMESTAMP(2) YY
So to make a comparison between the two you need to convert one into the other. You can do this many ways:
MySQL has a function called UNIX_TIMESTAMP() which you can use in your sql statement: $query = "DELETE FROM $table_basket WHERE UNIX_TIMESTAMP(TIME) > $deletetime"
Or you could convert your unix timestamp into a MySQL timestamp using the date() function in PHP: $deletetime = date('Y-m-d HⓂs', timestamp())
There are other ways to do this, but these are probably the two best suited to your purpose. I'd suggest that you uset the second one since it will allow you to convert $currenttime also. Second I'd double check your logic I think you want to substract 10 seconds from $deletetime not add 10 seconds, and you probably want to check where TIME < $deletetime (less than not > greater than).