'Read a cached tile.
If found, update the used column in the tiles table with current time.'

def read(self, layer, coord, format):

    sys.stderr.write(('read    %d/%d/%d,    %s' % (coord.zoom, coord.column, coord.row, format)))
    path = self._filepath(layer, coord, format)
    fullpath = pathjoin(self.cachepath, path)
    if exists(fullpath):
        body = open(fullpath, 'r').read()
        sys.stderr.write(('...hit    %s,    set    used=%d' % (path, time.time())))
        db = connect(self.dbpath).cursor()
        db.execute('UPDATE    tiles\n                                                                                                        SET    used=?\n                                                                                                        WHERE    path=?', (int(time.time()), path))
        db.connection.commit()
        db.connection.close()
    else:
        sys.stderr.write('...miss')
        body = None
    return body
