UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QdZCqOaeQ/ynZoqrHwhGLY28CZ85M1jPn/jyM/z+3Y8=' 
WHERE 
  key_id = '8c1c7094d000dd581d366531dd1b51fb2bb23deeb318754bc51f80aaf2d7f496' 
  AND (
    token = 'QdZCqOaeQ/ynZoqrHwhGLY28CZ85M1jPn/jyM/z+3Y8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034